package model;

import java.util.ArrayList;


/**
 * The Schedulers User Class.
 * @author Justin Kudlo
 */
public class Scheduler extends User{

	/** 
	 * The Constant serialVersionUID.
	 */
	private static final long serialVersionUID = 
		-2207393355187986380L;
	
	/** 
	 * The group leader requests. 
	 */
	private static ArrayList<Volunteer> theGLRequests;
	
	/** 
	 * The users jobs. 
	 */
	private Jobs myJobs;
	
	/** 
	 * The list of all users. 
	 */
	@SuppressWarnings("unused")
	private Users myUsers;
	
	/**
	 * Instantiates a new scheduler.
	 */
	public Scheduler()
	{
		super();
	}
	
	/**
	 * Instantiates a new scheduler.
	 *
	 * @param first the users first name.
	 * @param last the users last name.
	 * @param pass the users password.
	 * @param phone the users phone number.
	 * @param dob the users date of birth.
	 * @param email the users email address.
	 * @param userName the users username.
	 * @param theJobs the users jobs to schedule.
	 * @param theUsers the list of all users.
	 */
	public Scheduler(final String first,
			final String last,
			final String pass,
			final String phone,
			final String dob,
			final String email,
			final String userName,
			Jobs theJobs, Users theUsers) 
	{
		super(first, last, pass, phone, dob, email, 
				userName);
		myJobs = theJobs;
		myUsers = theUsers;
	}

	/**
	 * Promote volunteer to group leader.
	 *
	 * @param theVol the volunteer to be promoted.
	 */
	public void promoteVoltoGL(Volunteer theVol)
	{
		if(theGLRequests.contains(theVol))
		{
			theGLRequests.remove(theVol);
		}
		
		theVol.setGLStatus(true);
	}
	
	/**
	 * Deny users request for a job.
	 *
	 * @param theRequest the request
	 */
	public void denyRequest(final Job theRequest)
	{
		myJobs.denyRequest(theRequest); 
	}
	
	/**
	 * Removes user from the job.
	 *
	 * @param theJob the job
	 */
	public void removeJob(final Job theJob)
	{
		myJobs.deleteJob(theJob);
	}
}
